<?php
    require ('../Config.php');
    $user_name = $_POST["user_name"];
    $right_num = $_POST["right_num"];
    $error_num = $_POST["error_num"];
    $other_num = $_POST["other_num"];
    $conn = new mysqli($MySqlHost,$MySqlUser,$MySqlPwd,$MySqlDatabaseName);
    mysqli_query($conn, "set character set 'utf8'");//读库
    mysqli_query($conn,"set names 'utf8'");//写库
    if(mysqli_num_rows(mysqli_query($conn,"SELECT * FROM user_users WHERE User_Name = '$user_name'"))>0){
        mysqli_query($conn,"UPDATE user_users SET aggregate = aggregate + $other_num,right_num = right_num + $right_num,error_num = error_num + $error_num where User_Name = '$user_name'");
        echo "YES";
    }else{
        echo "NO";
    }

    mysqli_close($conn);